<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Test</title>
    <script>
        let el = console.log;

        let son = {
            name: 'Son'
        }
        let person = {
            name: 'Person',
            sayName:function(){
                return this.name   //使用son去调用函数 this表示当前对象son
            }
        }

        Object.setPrototypeOf(son, person)
        el(son)
        // el(son.__proto__.name)  //不能通过[[prototype]]去获取内部值
  
        el(son.sayName())   //目的达到 能在原型定义并且访问方法


        //获取原型
        Object.getPrototypeOf(son)   //得到person
    </script>
</head>

<body>
    <h1>Test页面</h1>
</body>

</html>